package lab01;

import java.util.Scanner;

public class Test07 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数：");
        int guessnumber = (int) (Math.random() * 100) + 1;  //自动导入一个数
        while  (true)   {
        int result = sc.nextInt();
        if (result > guessnumber)  {//   判断输入的数和导入的数
        System.out.println("不好意思猜大了");
    }   else if (result < guessnumber) {
                System.out.println("不好意思猜小了");
    }   else  {
                System.out.println("恭喜你猜对了");
                break;
    }
    }
    }
}
